import { Limits } from '@boticord/consts'
import { IsIn, IsInt, IsString, Length, MinLength } from 'class-validator'
import { UpdateBotDto } from './update-bot.dto'
import { enumToValues } from '@boticord/common'
import { QualityCheckMethods } from '@boticord/consts/quality-check-methods'

export class CreateBotDto extends UpdateBotDto {
  @IsString()
  @Length(Limits.MinDiscordIdLength, Limits.MaxDiscordIdLength)
  declare id: string

  @IsString()
  @Length(Limits.MinDiscordIdLength, Limits.MaxDiscordIdLength)
  declare owner: string

  @IsInt()
  @IsIn(enumToValues(QualityCheckMethods))
  declare qualityCheckMethod: number

  @IsString()
  @MinLength(1)
  declare comment: string

  @IsString()
  declare token: string // cloudflare turnstile token
}
